#https://blog.csdn.net/dmjz_lk/article/details/87784645
#https://graphene-python.org/
from flask import Flask
import graphene
#from flask_graphql import GraphQLView
from flask_graphql.graphqlview import GraphQLView

class Query(graphene.ObjectType):
    hello_world= graphene.String(description='ces')

    @staticmethod
    def resolve_hello_world(obj, info, **kwargs):
        return "Hello World!"

app = Flask(__name__)


@app.route("/")
def hello():
    return "Hello World!"
schema = graphene.Schema(query=Query, auto_camelcase=False)

app.add_url_rule('/graphql', view_func=GraphQLView.as_view('graphql', schema=schema, graphiql=True))

if __name__=='__main__':
    app.run('0.0.0.0',port=5555)
